import React from 'react';
import { Router, Route, browserHistory, hashHistory } from 'react-router'
import Login from 'containers/login/login'
import menuRoute from 'routes/menuRoute'

class AppComponent extends React.Component {

  //Route的渲染写在render外面，避免You cannot change <Router routes>; it will be ignored警告
  routes = [].concat(menuRoute.getClientRoute()).concat(<Route path="/" component={Login} />);

  render() {
    const supportBrowserHistory = typeof history.pushState !== 'undefined';
    console.log(this.routes)
    return (
      <Router history={supportBrowserHistory ? browserHistory : hashHistory} routes={this.routes}/>
    );
  }
}

AppComponent.defaultProps = {
};

export default AppComponent;
